package com.fare.taluo.web.action.flight;

import java.util.List;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.fare.taluo.application.plane.channel.SourceApplication;
import com.fare.taluo.vo.core.SourceEntityVO;

/**
 * 航班价差统计
 * @author guokenye
 *
 */
@Controller
@Scope("prototype")
@Namespace("/flight/flightPriceDifferenceStats")
public class FlightPriceDifferenceStatsAction {
	private String compareCompany;//比较的航空公司
	private String[] compareChannel;//比较的渠道，可能多个
	private String crawlDate;//抓取日期
	private Integer futureDay;//未来天数
	private Double priceProportion;//价差比例
	private String fromCityName;//出发城市
	private String toCityName;//到达城市
	private List<SourceEntityVO> crawlCompanys;//所有的当前处于抓取状态的公司
	private List<SourceEntityVO> crawlChannels;//所有的当前处于抓取状态的渠道
	@Resource(name="sourceApplication")
	private SourceApplication sourceApplication;
	
	/**
	 * jsp页面
	 * @return
	 * @throws Exception
	 */
	@Action(value="toJsp",results={@Result(name="dispatcher", type="dispatcher",location="")})
	public String toJsp()throws Exception{
		this.crawlCompanys=sourceApplication.findCrawlAirCompanys();
		this.crawlChannels=sourceApplication.findCrawlChannel();
		return "dispatcher";
	}
}
